<?php if (!defined('SERVER_ROOT')) exit('No direct script access allowed');
$this->template->title = 'In danh bảng lương';
$v_row = 0;
$STT = 0;
?>
<style>
    body
    {
        background-color: #fff;
    }
    .khung
    {
        float: left; width: 100%; height: auto; position: relative; 
    }

    .cottrai
    {
        float: left; width: 40%; height: 100%; position: relative;  text-align: center; border: none; vertical-align: top;
    }
    .cotphai
    {
        float: right; width: 50%; height: 100%; border:none; position: relative;  text-align: center; padding-left: 15px; border: none; vertical-align: top;
    }
    .dau_gach_ngang
    {
        width: 100%; position: relative; float: left; border-top: 1px #ccc dashed; height: 1px;
    }
    table
    {
        font-size: 14px;
    }
    td
    {
        vertical-align: top;
    }
    .no_border
    {
        border: none;
    }
</style>
<?php
$arr_cac_hoso = "";
$arr_ma_cac_hoso = '';
$arr_ngay_nhanhs = "";
$i = 0;
?>


<?php //endwhile;
?>


<div id="print-button">
    <input type="button" id="printbutton" value="In trang" class="print"  />
</div>
<div class="khung" id="lien1">
    <table cellpadding="2px" cellspacing ="2px" border="0" width="100%" height="auto">
        <tr>
            <td class="cottrai">
                TRƯỜNG ĐẠI HỌC TIỀN GIANG<br />

            </td>
            <td class="cotphai" style="vertical-align:top;font-weight: bold; text-align: center" >
                CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM <br />
        <u>Độc lập - Tự do - Hạnh phúc</u>
        </td>
        </tr>
        <tr>
            <td style="text-align: center; " colspan="2" class="no_border" >
                <span style="font-size: 18px; font-weight: bold;">BẢNG LƯƠNG THÁNG <?php echo $var_thanglanhluong?> NĂM <?php echo $var_namlanhluong?></span>

            </td>
        </tr>
        <tr>
            <td colspan="2" class="no_border">
            <table  width="100%" class="adminlist" cellspacing="0" border="1">
        <colgroup>
            <col width="3%" />
            <col width="12%" />
            <col width="5%" />
            <col width="10%" />
            <col width="10%" />
            <col width="4%" />
            <col width="5%" />
            <col width="7%" />
            <col width="5%" />
            <col width="7%" />
            <col width="7%" />
            <col width="7%" />
            <col width="7%" />
            <col width="9%" />

        </colgroup>
        <tr>
            <th rowspan="2">STT</th>
            <th rowspan="2">Tên cán bộ</th>
            <th rowspan="2">Năm sinh</th>
            <th rowspan="2">Chức vụ</th>
            <th colspan="2">Hệ số lương hiện tại</th>
            <th colspan="3">Phụ cấp</th>
            <th rowspan="2">Tiền lương</th>
            <th colspan="3">Tiền phụ cấp</th>
            <th rowspan="2">Tổng cộng</th>
        </tr>
        <tr>
            <th>Bậc/Ngạch</th>
            <th>HSL</th>
            <th>Chức vụ</th>
            <th>Trách nhiệm</th>
            <th>Ưu đãi</th>
            <th>Chức vụ</th>
            <th>Trách nhiệm</th>
            <th>Ưu đãi</th>
        </tr>
         <?php while ($arr = $arr_all_tinhluong->FetchRow()): ?>
             <?php
             $id=1;
             $STT=$STT+1;
             $MA_CAN_BO=$arr['MA_CAN_BO'];
             $TEN_CAN_BO=$arr['TEN_CAN_BO'];
             $NAM_SINH=$arr['NAM_SINH'];
             $CHUC_VU_HIEN_TAI=$arr['CHUC_VU_HIEN_TAI'];
             $TEN_BAC_NGACH_HIEN_TAI=$arr['TEN_BAC_NGACH_HIEN_TAI'];
             $HE_SO_LUONG_HIEN_TAI=$arr['HE_SO_LUONG_HIEN_TAI'];
             $HE_SO_PHU_CAP_CHUC_VU=$arr['HE_SO_PHU_CAP_CHUC_VU'];
             $HE_SO_PHU_CAP_TRACH_NHIEM=$arr['HE_SO_PHU_CAP_TRACH_NHIEM'];
             $HE_SO_PHU_CAP_UU_DAI=$arr['HE_SO_PHU_CAP_UU_DAI'];
             $TIEN_LUONG=$arr['TIEN_LUONG'];
             $TIEN_PCCV=$arr['TIEN_PCCV'];
             $TIEN_PCTN=$arr['TIEN_PCTN'];
             $TIEN_PCUD=$arr['TIEN_PCUD'];
             $TONG_LUONG=$arr['TONG_LUONG'];
             $v_class = 'row' . ($v_row % 2);
             $v_row++;
            ?>
            <tr class="<?php echo $v_class;?>">
                <td style="text-align:center;vertical-align: middle"><?php echo $STT;?></td>
                <td ><?php echo $TEN_CAN_BO;?></td>
                <td style="text-align:center;vertical-align: middle"><?php echo $NAM_SINH;?></td>
                <td><?php echo $CHUC_VU_HIEN_TAI;?></td>
                <td><?php echo $TEN_BAC_NGACH_HIEN_TAI;?></td>
                <td style="text-align:center;vertical-align: middle"><?php if ($HE_SO_LUONG_HIEN_TAI!='0.00') echo $HE_SO_LUONG_HIEN_TAI;?></td>
                <td style="text-align:center;vertical-align: middle"><?php if ($HE_SO_PHU_CAP_CHUC_VU!='0.00') echo $HE_SO_PHU_CAP_CHUC_VU;?></td>
                <td style="text-align:center;vertical-align: middle"><?php if ($HE_SO_PHU_CAP_TRACH_NHIEM!='0.00') echo $HE_SO_PHU_CAP_TRACH_NHIEM;?></td>
                <td style="text-align:center;vertical-align: middle"><?php if ($HE_SO_PHU_CAP_UU_DAI!='0%') echo $HE_SO_PHU_CAP_UU_DAI;?></td>
                <td style="text-align:center;vertical-align: middle"><?php if ($TIEN_LUONG!=0) echo $TIEN_LUONG;?></td>
                <td style="text-align:center;vertical-align: middle"><?php if ($TIEN_PCCV!=0) echo $TIEN_PCCV;?></td>
                <td style="text-align:center;vertical-align: middle"><?php if ($TIEN_PCTN!=0) echo $TIEN_PCTN;?></td>
                <td style="text-align:center;vertical-align: middle"><?php if ($TIEN_PCUD!=0) echo $TIEN_PCUD;?></td>
                <td style="text-align:center;vertical-align: middle"><?php if ($TONG_LUONG!=0) echo $TONG_LUONG;?></td>
            </tr>
           <?php endwhile; ?>
        <?php echo $this->add_empty_rows($v_row, _CONST_DEFAULT_ROWS_PER_PAGE, 14);?>
    </table>
           </td>
        <tr>

    </table>
    <br />    </div><br />
<br />

<script>
    var button = document.getElementById('printbutton'); // Assumes element with id='button'
    button.onclick = function() {
        var div = document.getElementById('print-button');
        if (div.style.display !== 'none') {
            div.style.display = 'none';
        }
        else {
            div.style.display = 'block';
        }
        window.print();

    };
</script>
<script type="text/javascript">

    $(document).ready(function() {
        var max_height = 580;
        if ($("#lien1").height() > max_height)
        {
            $("#lien1,#lien2").height(960);
        }
    });

</script>

